/**
 *@author lxc
 *@description: 返回日期为英文
 *@param:time：日期格式(2022-02-1),prefix是在前面加一个As at
 *@date: 2022-07-29 10:16:29
 **/
export function getTimeEN(time: string, prefix: string) {
  if (!time) return ''
  const timeArr = time.split('-')
  let timeStr = ''
  if (timeArr.length <= 1) {
    timeStr = time
  } else if (timeArr.length == 2) {
    timeStr = getMoonEN(Number(timeArr[1])) + ' ' + timeArr[0]
  } else if (timeArr.length == 3) {
    timeStr = prefix + timeArr[2] + ' ' + getMoonEN(Number(timeArr[1])) + ' ' + timeArr[0]
  }
  return timeStr
}
export function getMoonEN(mon: Number) {
  let str = ''
  // console.log(mon)
  switch (mon) {
    case 1:
      // January
      str = 'Jan'
      break
    case 2:
      // February
      str = 'Feb'
      break
    case 3:
      // March
      str = 'Mar'
      break
    case 4:
      // April
      str = 'Apr'
      break
    case 5:
      str = 'May'
      break
    case 6:
      // June
      str = 'Jun'
      break
    case 7:
      // July
      str = 'Jul'
      break
    case 8:
      // August
      str = 'Aug'
      break
    case 9:
      // September
      str = 'Sep'
      break
    case 10:
      // October
      str = 'Oct'
      break
    case 11:
      // November
      str = 'Nov'
      break
    // December
    case 12:
      str = 'Dec'
      break
    default:
      break
  }
  return str
}
